package model;


/**
 * CourseHistory.java
 * Purpose: this class represents a students history for a course taken
 * 
 * @author Wim Vandebriel
 * @version 1.0 05/11/2011
 */

public class CourseHistory implements Business {

	private Course course;
	private Student student;
	private String schoolYear;
	private int score;


	public CourseHistory(){}
	/**
	 * Constructs a course history object
	 * @param course The course that was taken
	 * @param schoolYear The year when the course was taken
	 * @param score The score that was earned for the course
	 */
	
	
	
	public CourseHistory(Student student, Course course,String schoolYear, int score) {
		this.student = student;
		this.schoolYear = schoolYear;
		this.score = score;
		this.course = course;
	}

	/** Returns the year when the given course was followed */
	public String getSchoolYear() {
		return schoolYear;
	}

	/** Sets the year when the course was followed */
	public void setSchoolYear(String schoolYear) {
		this.schoolYear = schoolYear;
	}

	/** Returns the score that was given for the given course in the given year */
	public int getScore() {
		return score;
	}

	/** Sets the score that was given for the given course in the given year */
	public void setScore(int score) {
		this.score = score;
	}

	/** Returns the course */
	public Course getCourse() {
		return course;
	}

	/** Sets the course */
	public void setCourse(Course course) {
		this.course = course;
	}
	
	
	
	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	/** Returns a string representation of the course history object */
	@Override
	public String toString() {
		return String.format("%s taken in year %s. Grade : %d", this.course.getName(), this.schoolYear, score);
	}


}
